package com.hangzhou.welbeing.welbeinginstrument.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.Toast;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.utils.Utils;
import com.hangzhou.welbeing.welbeinginstrument.view.SwitchButton;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 时间 2017 年 09 月 21.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.activity
 * 工程名 welbeing_pregnant
 */
public class NewMessageActivity extends Activity {
    private static final String TAG = "NewMessageActivity";
    @Bind(R.id.activity_new_message_iv_return)
    ImageView activityNewMessageIvReturn;
    @Bind(R.id.activity_new_message_switchButton)
    SwitchButton activityNewMessageSwitchButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_message);
        ButterKnife.bind(this);

        Utils.setStatusBar(this,false,false);
        Utils.setStatusTextColor(true,this);


        activityNewMessageSwitchButton.setOnCheckedChangeListener(new SwitchButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(SwitchButton buttonView, boolean isChecked) {
                if(isChecked){
                    //Log.e(TAG,"=============="+isChecked); //关
                    Toast.makeText(NewMessageActivity.this,"关闭消息",Toast.LENGTH_SHORT).show();
                }else{
                   // Log.e(TAG,"=============="+isChecked); //开
                    Toast.makeText(NewMessageActivity.this,"打开消息",Toast.LENGTH_SHORT).show();
                }
            }
        });

    }

    @OnClick(R.id.activity_new_message_iv_return)
    public void onViewClicked() {
        finish();
    }
    @Override
    public void onBackPressed() {
        super.onBackPressed();
        finish();
        overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
    }
}
